package com.yiya.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.yiya.bean.News;
import com.yiya.model.NewsExample;
import com.yiya.model.NewsModel;

public interface NewsMapper {
    int countByExample(NewsExample example);

    int deleteByExample(NewsExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(News record);

    int insertSelective(News record);

    List<News> selectByExample(NewsExample example);

    News selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") News record, @Param("example") NewsExample example);

    int updateByExample(@Param("record") News record, @Param("example") NewsExample example);

    int updateByPrimaryKeySelective(News record);

    int updateByPrimaryKey(News record);
    
    List<News> selectByModel(NewsModel model);
    
    int countByModel(NewsModel model);
    
    /**
     * 获取放置在首页的新闻
     * @param param
     * @return
     */
    List<News> selectIndexNews(Map<String, Object> param);
}